perm filename CHIMPS[S,TES] blob sn#009963 filedate 1971-11-16 generic text, type T, neo UTF8
00100			MONKEY-BANANA FORMULATION
00200	
00300		WORLD
00400	
00500	The room is quantized into NX ⊗ NY ⊗ NZ cubes of equal size, called
00600	"places".  There are two sizes of thing; "big" things are the same
00700	size as a "place", and "small" things are much smaller.  The places
00800	are identified by three coordinates (X,Y,Z), in the range
00900	(0:XMAX, 0:YMAX, 0:ZMAX).  When X=0|XMAX or Y=0|YMAX, there is usually
01000	a wall board.  When Z=0, there is usually a floor board.  When Z=ZMAX,
01100	there is a ceiling board that sometimes has a hook in it, suitable
01200	for hanging bananas directly or via a string.  The floor board at
01300	(X,Y,0) is abbreviated FLOOR(X,Y); the hook at (X,Y,ZMAX) as HOOK(X,Y),
01400	etc.
01500	
01600	Things are big or small, animal or object.  Animals are agile or strong,
01700	and objects are edible or inedible.  Chimps are agile animals, gorillas
01800	are strong animals, bananas are edible objects, and boxes, strings, and
01900	sticks are inedible.  Boxes and animals and strings are big; bananas and sticks
02000	are small.
02100	
02200	Two big things can not occupy the same place at the same time.  There
02300	is no restriction on small things sharing space with big things or with
02400	other small things.  If an animal is HOLDing a small thing, the small
02500	thing moves with the animal.
02600	
02700	Gravitation makes any unsupported thing fall straight down until it
02800	encounters a floor-board or a box to top-support it, or an animal to hold
02900	it if it's small.  There are four kinds of support: an animal holds
03000	a small thing; a string or hook bottom-supports a small thing; a box
03100	or floor top-supports anything; a box side-supports an agile animal.
03200	If an object is supported in several ways, the first kind of support
03300	in the following list takes precedence: Gorilla-Hold > Chimp-Hold >
03400	Bottom-Support > Side-Support > Top-Support.  If a supporter moves,
03500	what it supports moves with it, but not vice versa.  This means that
03600	if both a gorilla and a chimp are holding a banana, and the animals
03700	move apart, the gorilla winds up with the banana.
03800	
03900	The notation ∂m-n ε [x0:x1,y0:y1,z0:z1] means that the location (mx,my,mz)
04000	of m and the location (nx,ny,nz) of n differ by an amount in the range
04100	x0≤mx-nx≤x1, y0≤my-ny≤y1, z0≤mz-nz≤z1.  Thus, ∂Box1-Chimp1 ε [-1:1,-1:1,0]
04200	means that both the box and the chimp are at the same altitude and are
04300	in adjacent places (cube faces, edges, or corners touch).
04400	
04500	Each animal has two hands that may be free or in use.  One use of a hand
04600	is to hold a small thing.  A second use is to maintain the side support
04700	of a box.  Other actions may require temporary use of one or both hands.
     

00100		ACTIONS
00200	
00300	Each action has a precondition and a postcondition.  If motion
00400	is entailed by an action, the simulator assures that the laws of
00500	physics are not violated (place sharing, gravitation).  If use of
00600	hands is involved, the simulator assures that the animal has the free
00700	hands needed.  If the action results in an unsupported thing, the
00800	simulator makes it fall instantly.  If a supporter moves, what it supports
00900	is moved with it. If support is a consequence of any action, the location
01000	of the supported thing is automatically changed to be adjacent to the
01100	supporter (above for top-support, below for bottom-support, alongside
01200	on the side of approach for side-support).
01300	
01400	Agile Animal C CLIMBS TO SIDE OF Box B
01500		FROM	∂C-B ε [-1:1,-1:1,-1:1]
01600		TO	B Side-Supports C
01700	
01800	Animal C CLIMBS TO TOP OF Box B
01900		FROM	∂C-B ε [-1:1,-1:1,0:1]
02000		TO	B Top-Supports C
02100	
02200	Animal M NUDGES Box B to Location L
02300		FROM	∂M-B = ∂B-L = D ε [-1:1,-1:1,0]
02400			M has 2 hands free
02500			B Supports (if M is Strong then 0:1 else 0) Things
02600		TO	∂B-L = 0
02700			∂M-L = D
02800	
02900	Animal M GIVES Small Object K TO Animal N
03000		FROM	∂M-N ε [-2:2, -2:2, -2:2]
03100			M holds K
03200		TO	N holds K		M ¬Holds K
03300	
03400	Animal M DROPS Small Object K
03500		FROM	M Holds K
03600		TO	M ¬Holds K
03700	
03800	Strong Animal G LIFTS Box B TO Location L
03900		FROM	G has 2 hands free
04000			B Supports 0 Things
04100			∂G-L ε [-1:1,-1:1,-1:0]
04200			∂B-G ε [-1:1,-1:1,0:1]
04300		TO	∂B-L = 0
04400	
04500	Animal M KNOCKS LOOSE Small Object K
04600		FROM	∃S: S is a stick, Length S = L, M holds S
04700			∃H: H bottom-supports K
04800			∂M-K ε [-(L+1):(L+1), -(L+1):(L+1), -(L+1):L]
04900		TO	H ¬bottom-supports K
     

00100	Animal M EATS Edible Object E
00200		FROM	M Holds E
00300			M is Hungry
00400		TO	E ¬Appears
00500			M is ¬Hungry
00600	
00700	Animal M GRASPS Small Object K
00800		FROM	∂M-K ε [-1:1,-1:1,-1:1]
00900		TO	M Holds K
01000	
01100	Animal M STEPS TO Location L
01200		FROM	∂M-L ε [-1:1,-1:1,0:1]
01300		TO	∂M-L = 0
01400	
01500		INITIAL STATES
01600	
01700	XMAX = 10
01800	YMAX = 10
01900	ZMAX = 6
02000	FLOOR everywhere; HOOKs at (5,5) and (7,5)
02100	HOOK(5,5) Bottom-Supports STRING1
02200	STRING1 Bottom-Supports STICK1
02300	HOOK(7,5) Bottom-Supports BANANA1
02400	FLOOR(2,2) Top-Supports BOX1
02500	FLOOR(8,8) Top-Supports BOX2
02600	FLOOR(9,8) Top-Supports CHIMP1
02700	FLOOR(1,5) Top-Supports BOX3
02800	FLOOR(6,5) Top-Supports GORILLA1
02900	
03000	
03100		PROBLEM
03200	
03300	Make a plan for GORILLA1, who is hungry, to become ¬hungry.  Assume
03400	the chimp is cooperative.
03500